package com.example.demo1;

public class DemoTest1 {

    public static void main(String[] args) {

        Context context = new Context();

        State state = new ConcreteStateA();

        state.handle(context);
        System.out.println("state = " + context.getCurrentState().toString());

        State state1 = new ConcreteStateB();

        state1.handle(context);
        System.out.println("state = " + context.getCurrentState().toString());

    }

}
